package com.whmall.service.crm.provider;

import com.whmall.component.entity.dto.ApproveReqDTO;
import com.whmall.component.entity.dto.ProcessInstanceCompletedMessageReqDTO;
import com.whmall.component.entity.dto.UserTaskCompletedMessageReqDTO;
import com.whmall.component.entity.dto.UserTaskCreatedMessageReqDTO;
import com.whmall.service.crm.api.CompanyAndUserApplicationApi;
import com.whmall.service.crm.entity.dto.company.CompanyAndUserApplicationReqDTO;
import com.whmall.service.crm.entity.dto.company.CompanyAndUserApplicationRspDTO;
import com.whmall.service.crm.module.company.service.CompanyAndUserApplicationService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

@Service(interfaceClass = CompanyAndUserApplicationApi.class)
public class CompanyAndUserApplicationProvider implements CompanyAndUserApplicationApi {

    @Autowired
    private CompanyAndUserApplicationService companyAndUserApplicationService;

    @Override
    public Map<Long, CompanyAndUserApplicationRspDTO> selectByIds(List<Long> ids) {
        return companyAndUserApplicationService.selectByIds(ids);
    }

    @Override
    public List<CompanyAndUserApplicationRspDTO> selectBy(CompanyAndUserApplicationReqDTO reqDTO) {
        return companyAndUserApplicationService.selectBy(reqDTO);
    }

    @Override
    public void createUserTask(UserTaskCreatedMessageReqDTO message) {
        companyAndUserApplicationService.createUserTask(message);
    }

    @Override
    public void verifyUserTask(UserTaskCompletedMessageReqDTO message) {
        companyAndUserApplicationService.verifyUserTask(message);
    }

    @Override
    public void finishWorkflow(ProcessInstanceCompletedMessageReqDTO message) {
        companyAndUserApplicationService.finishWorkflow(message);
    }

    @Override
    public void updateApplicantParam(ApproveReqDTO reqDTO) {
        companyAndUserApplicationService.updateApplicantParam(reqDTO);
    }

    @Override
    public void updateProcessInstanceId(Long id, String processInstanceId) {
        companyAndUserApplicationService.updateProcessInstanceId(id,processInstanceId);
    }

}
